<template>
   <div style="height:100%;width:100%;margin-bottom: 5%;">
     <apexchart height="100%" type="area" :options="chartOptions" :series="series"></apexchart>
   </div>
</template>

<script>
import { mapState } from 'vuex'
export default {
name:'DataManage',
data(){
    return {
        chartOptions: {
          chart: {
            id: 'vuechart-example'
          },
          xaxis: {
            // 过去10s的网站访问量
            categories: ['0', '1', '2', '3', '4', '5', '6', '7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23']
          }
        },
        series: [{
          name: '访问量',
          data: []
        }]
      }
},
mounted(){
  this.__flushData()
},
methods:{
  __flushData(){
    // 获取网站访问量
    this.$basicAxios(this.$manage.getWebsiteDay(this.token),(resp)=>{
      this.series = [{name:'访问量',data:resp.data.data}]
    })
  }
},
computed:{
  ...mapState('userAbout',['token'])
}
}
</script>

<style>

</style>